package com.apexcode.logisticsservice.listener;

import com.apexcode.orderservice.model.OrderInfo;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName OrderListener
 * @Description
 * @Author ZJX
 * @Date 2025/1/10 20:17
 * @Version 1.0
 **/

@Component
@RabbitListener(queues = "order-create")
public class OrderListener {
    @RabbitHandler
    public void handMessage(String message){
        System.out.println("Message接收到订单信息: "+message);
    }

    @RabbitHandler
    public void handMessage(OrderInfo orderInfo){
        System.out.println("OrderInfo接收到订单信息: "+orderInfo);
    }

}
